package com.example.xueshen.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.xueshen.common.dao.BanMapper;
import com.example.xueshen.common.entity.Ban;
import com.example.xueshen.common.entity.Teacher;
import com.example.xueshen.common.service.BanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class   BanServiceImpl implements BanService {
    @Resource
    private BanMapper banMapper;
    @Override
    public List<Ban> selectAllByPlus() {
        return banMapper.selectList(null);
    }

    @Override
    public Ban selectOneById(Integer bid) {
        return banMapper.selectById(bid);
    }



    @Override
    public boolean update(Ban ban) {
        return banMapper.updateById(ban)>0;
    }

    @Override
    public Page<Ban> selectAllByPlusAndPage(Page<Ban> page) {
        return banMapper.selectPage(page,null);
    }

    @Override
    public Page<Ban> selectBy(Page<Ban> page, QueryWrapper<Ban> queryWrapper) {
        return banMapper.selectPage(page,queryWrapper);
    }

    @Override
    public boolean updateById(Ban ban) {
        return banMapper.updateById(ban)>0;
    }

    @Override
    public Boolean insert(Ban ban) {
        return banMapper.insert(ban)>0;
    }

    @Override
    public boolean deleteById(Integer tid) {
        return banMapper.deleteById(tid)>0;
    }

}
